package co.rcantor.dev.siasar.comunidad;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemSelectedListener;
import android.widget.ArrayAdapter;
import android.widget.EditText;
import android.widget.Spinner;
import co.rcantor.dev.siasar.R;

public class TabComunidad4 extends Activity{

	private static String etnia;
	
	private static EditText raza2;
	private static EditText san_esc1;
	private static EditText san_esc2;
	private static EditText san_esc3;
    
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        
        setContentView(R.layout.tabcomunidad4);

        Spinner raza = (Spinner) findViewById(R.id.etnia_com);
        ArrayAdapter<CharSequence> adraza= ArrayAdapter.createFromResource(
                this, R.array.etnia, android.R.layout.simple_spinner_item);
        adraza.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
        raza.setAdapter(adraza);
        raza.setOnItemSelectedListener(new MyOnItemSelectedListener3());  
        
        raza2 = (EditText) findViewById(R.id.otra_etnia);
        san_esc1 = (EditText) findViewById(R.id.viv4_saneamiento_com);
        san_esc2 = (EditText) findViewById(R.id.viv5_saneamiento_com);
        san_esc3 = (EditText) findViewById(R.id.viv6_saneamiento_com);

        
    }
	
    public class MyOnItemSelectedListener3 implements OnItemSelectedListener {

	    public void onItemSelected(AdapterView<?> parent,
	        View view, int pos, long id) {
	    	setEtnia((pos+1)+"");

	    }

	    public void onNothingSelected(AdapterView<?> parent) {
	    	setEtnia("1");
	    }
	}

	public static String getEtnia() {
		return etnia;
	}

	public static void setEtnia(String etnia) {
		TabComunidad4.etnia = etnia;
	}	

	public static EditText getRaza2() {
		return raza2;
	}

	public static EditText getSan_esc1() {
		return san_esc1;
	}

	public static EditText getSan_esc2() {
		return san_esc2;
	}

	public static EditText getSan_esc3() {
		return san_esc3;
	}   

}
